﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using VietImage.Models;

namespace VietImage.ViewModels
{
    public class HomeViewModel
    {

        public List<Image> DailyImages = new List<Image>();

        public List<Category> WeeklySubCategories = new List<Category>();

        public List<Category> ParentCategories = new List<Category>();

        public HomeViewModel()
        {
            int n;
            DailyImages = Image.GetListAvailable(8, 0, out n);
            WeeklySubCategories = Category.GetListAvailableSubCategories().OrderByDescending(p=>p.CreatedTime).Take(8).ToList();
            ParentCategories = Category.GetListAvailableParentCategories();
        }
    }
}